export const initTopDataCf = [
        {
          title: '违规待办',
          key: 'weiguiliter',
          listIds: [{
            title: '待处理',
            key: 'dcl',
            val: 0,
            status: true
          },
          {
            title: '违规预警',
            key: 'wgyj',
            val: 0,
            status: true
          }]
        },
      
        {
          title: '订单待办',
          key: 'dddb',
          listIds: [{
            title: '待发货',
            key: 'dfh',
            val: 0,
            status: true
          },
          {
            title: '待支付',
            key: 'dzfw',
            val: 0,
            status: true
          }]
        },
      
        {
          title: '售后待办',
          key: 'shouhoudaiban',
          listIds: [{
            title: '待处理售后',
            key: 'dclsh',
            val: 0,
            status: true
          },
          {
            title: '待处理服务单',
            key: 'dclfwd',
            val: 0,
            status: true
          }]
        },
      
        {
          title: '营销待办',
          key: 'yingxiaodaiban',
          listIds: [{
            title: '邀约活动待报名',
            key: 'yyhddbm',
            val: 0,
            status: true
          },
          {
            title: '已报名待完善',
            key: 'ybmdws',
            val: 0,
            status: true
          }]
        },
      
        {
          title: '抖音商城待办',
          key: 'douyingshangchangdaibna',
          listIds: [{
            title: '商城准人待优化',
            key: 'sczrdyh',
            val: 0,
            status: true
          },
          {
            title: '搜索待优化商品',
            key: 'ssdyhsp',
            val: 0,
            status: true
          }]
        }
      ]

const moboInfoData = {
  val: 0,
  val_status: true,
  sub_val: 0,
  sub_val_show: "0",
  val_show_tab: "0",
  sub_val_status: true,
  icon_type: '0',
  icon_type_status: true
}
export const initJinyingDataCf = [
  {
    title: '成交金额',
    key: 'deal_amount',
    ...moboInfoData
  },
  {
    title: '成交订单量',
    key: 'deal_order_num',
    ...moboInfoData
  },
  {
    title: '成交人数',
    key: 'deal_customer_num',
    ...moboInfoData
  },
  {
    title: '商品曝光人数',
    key: 'product_total_show',
    ...moboInfoData
  },
  {
    title: '商品点击人数',
    key: 'product_total_click',
    ...moboInfoData
  },
  {
    title: '退款金额',
    key: 'refund_amount',
    ...moboInfoData
  },
  {
    title: '退款订单量',
    key: 'refund_order_num',
    ...moboInfoData
  }
]
const initTyfData = {
  "key": "",
  "val": 0,
  "action": {
    "type": 1,
    "jump_target": {
      "type": 2,
      "schema": "https://fxg.jinritemai.com/ffa/eco/experience-score?source=fxg-home",
      "content": "",
      "request_target": null,
      "pc_link": null,
      "type_name": "link"
    },
    "type_name": "jump"
  },
  "sub_title": "较前1天",
  "sub_val": "0",
  "icon_type": 0,
  "button": null,
  "remark": "",
  "status": true,
  "desc": "",
  "word": {
    "word": "高",
    "word_color": "#00C87F",
    "word_bkg": "219,255,239,1"
  },
  "sub_icon_type": 0
}
export const initTiyangfenDataCf = {
  expr_score: {
    compass_list: [
      {
        "title": "商品",
        ...initTyfData
      },
      {
        "title": "物流",
       ...initTyfData
      },
      {

        "title": "服务",
       ...initTyfData
      }
    ],
    main_compass: {
      "title": "体验分",
      "val": 0,
      "val_num": 0,
      "action": {
        "key": "",
        "type": 1,
        "jump_target": {
          "type": 2,
          "schema": "https://fxg.jinritemai.com/ffa/eco/experience-score?source=fxg-home",
          "content": "",
          "request_target": null,
          "pc_link": null,
          "type_name": "link"
        },
        "type_name": "jump"
      },
      "sub_title": "较前1天",
      "sub_val": 0,
      "icon_type": 0,

      "show_val": true,
      "show_sub_val": true,
      "show_icon_typs": true,
      
      "button": null,
      "remark": "",
      "desc": "",
      "word": {
        "word": "高",
        "word_color": "#00C87F",
        "word_bkg": "219,255,239,1"
      },
      "sub_icon_type": 0
    }
  },
  shop_data_info: {
    shop_data_item_list:  [
      {
        "key": "margin",
        "name": "保证金",
        "val": "￥10万",
        "val_num": 0,
        "status": true,
        "hover": null,
        "action": null,
        "button": null,
        "icon_list_info": null
      },
      {
        "key": "withdraw_amount",
        "name": "可提现金额",
        "val": "￥150.23万",
        "val_num": 0,
        "status": true,
        "hover": null,
        "action": null,
        "button": null,
        "icon_list_info": null
      },
      {
        "key": "honor_level",
        "name": "信誉等级",
        "val": "好",
        "val_num": 0,
        "status": true,
        "hover": {
          "icon": "https://lf3-static.bytednsdoc.com/obj/eden-cn/jpahaz_uhpkbvk_tvjl/ljhwZthlaukjlkulzlp/home_page/common_hover_icon.png",
          "type": 1,
          "text": "<div style='font-size: 12px; color: #fff; line-height: 18px;'>根据用户对店铺每一笔订单的评价情况（好/中/差/无评）分别计算得出信誉分（≥4分，将展示信誉等级）查看详情<a href='https://fxg.jinritemai.com/ffa/eco/credit-rating' target='_blank'>查看详情</a></div>",
          "pic": "",
          "url": ""
        },
        "action": {
          "type": 1,
          "jump_target": {
            "type": 2,
            "schema": "https://fxg.jinritemai.com/ffa/eco/credit-rating",
            "content": "",
            "request_target": null,
            "pc_link": null,
            "type_name": "link"
          },
          "type_name": "jump"
        },
        "button": {
          "type": 1,
          "text": "",
          "disabled": false,
          "action": {
            "type": 1,
            "jump_target": {
              "type": 2,
              "schema": "https://fxg.jinritemai.com/ffa/eco/credit-rating",
              "content": "",
              "request_target": null,
              "pc_link": null,
              "type_name": "link"
            },
            "type_name": "jump"
          },
          "icon": "",
          "type_name": ""
        },
        "icon_list_info": null
      }
    ]
  },
  show_chear: true
}

// 电商罗盘
export const initDslpDataCf = {
    "pay_amt": {

        "pay_amt_index_value": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 3,
                    "value": 0
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": -0.8553981946786003
                },
                "value": {
                    "unit": 3,
                    "value": 1308938
                }
            }
        },
        "pay_amt_index_values": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 3,
                    "value": 0
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": -0.8553981946786003
                },
                "value": {
                    "unit": 3,
                    "value": 1308938
                }
            }
        }
    },
    "pay_order_cnt": {

        "pay_order_cnt_index_value": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 5,
                    "value": 269
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": -0.9182156133828996
                },
                "value": {
                    "unit": 5,
                    "value": 22
                }
            }
        },
        "pay_order_cnt_index_values": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 5,
                    "value": 269
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": -0.9182156133828996
                },
                "value": {
                    "unit": 5,
                    "value": 22
                }
            }
        }
    },
    "pay_ucnt": {

        "pay_ucnt_index_value": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 5,
                    "value": 249
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": 0.9116465863453815
                },
                "value": {
                    "unit": 5,
                    "value": 22
                }
            }
        },
        "pay_ucnt_index_values": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 5,
                    "value": 249
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": 0.9116465863453815
                },
                "value": {
                    "unit": 5,
                    "value": 22
                }
            }
        }
    },
    "product_click_pay_rate": {

        "product_click_pay_rate_index_value": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 4,
                    "value": 0.189972
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": 0.20631812407442493
                },
                "value": {
                    "unit": 4,
                    "value": 0.22916666666666666
                }
            }
        },
        "product_click_pay_rate_index_values": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 4,
                    "value": 0.189972
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value":0.20631812407442493
                },
                "value": {
                    "unit": 4,
                    "value": 0.22916666666666666
                }
            }
        }
    },
    "product_refund_amt": {

        "product_refund_amt_index_value": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 3,
                    "value": 72374
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": -0.6653632519965733
                },
                "value": {
                    "unit": 3,
                    "value": 24219
                }
            }
        },
        "product_refund_amt_index_values": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 3,
                    "value": 72374
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": -0.6653632519965733
                },
                "value": {
                    "unit": 3,
                    "value": 24219
                }
            }
        }
    },
    "product_show_ucnt": {

        "product_show_ucnt_index_value": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 5,
                    "value": 18545
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": -0.9362631437045026
                },
                "value": {
                    "unit": 5,
                    "value": 1182
                }
            }
        },
        "product_show_ucnt_index_values": {
            "cell_type": 2,
            "index_values": {
                "last_value": {
                    "unit": 5,
                    "value": 18545
                },
                "out_period_ratio": {
                    "unit": 4,
                    "value": -0.9362631437045026
                },
                "value": {
                    "unit": 5,
                    "value": 1182
                }
            }
        }
    }
  }
  

const infodataconter = ["1", "20", "21", "23", "100"]

export const initDslpDataCfFun = () => {
  const outObject = {}
  Object.keys(initDslpDataCf).forEach((key: any) => {
    initDslpDataCf[key][`${key}_index_value`].index_values.out_period_ratio.reduTupe =  !initDslpDataCf[key][`${key}_index_value`].index_values.out_period_ratio.value?'0':initDslpDataCf[key][`${key}_index_value`].index_values.out_period_ratio.value>0?"17":'18'
    initDslpDataCf[key][`${key}_index_value`].index_values.out_period_ratio.value = initDslpDataCf[key][`${key}_index_value`].index_values.out_period_ratio.value? Math.abs(initDslpDataCf[key][`${key}_index_value`].index_values.out_period_ratio.value) : null
  })
  infodataconter.forEach((item: any) => {
    outObject[item] = JSON.parse(JSON.stringify(initDslpDataCf))    
  })
  outObject.show = true
  return outObject
}

export const meta = [
        {
            "attribute": {
                "index_uuid": 11551
            },
            "hide": false,
            "index_display": "成交金额",
            "index_name": "pay_amt",
            "index_tip": "截至所选统计周期内，抖音、火山、头条、西瓜四端支付成功（含货到付款）的订单金额汇总，含退款金额（非结算视角）"
        },
        {
            "attribute": {
                "index_uuid": 11604
            },
            "hide": false,
            "index_display": "商品曝光人数",
            "index_name": "product_show_ucnt",
            "index_tip": "本店全部商品在抖音、火山中的直播、短视频、商品卡曝光的去重人数（同一用户访问多个商品只被计算1次）"
        },
        {
            "attribute": {
                "index_uuid": 11606
            },
            "hide": false,
            "index_display": "商品点击支付率",
            "index_name": "product_click_pay_rate",
            "index_tip": "商品点击支付率(人数)=商品下单人数/商品点击人数"
        },
        {
            "attribute": {
                "index_uuid": 11607
            },
            "hide": false,
            "index_display": "商品退款金额",
            "index_name": "product_refund_amt",
            "index_tip": "截至所选统计周期内，全端所有退款成功商品产生的退款金额（仅含走售后系统且退款成功的订单，不含线下退款，包含发货前和发货后退款），以【退款成功时间】来判定，偏财务视角；举例：选定8.30日这一天，在8.30 24点前已为退款成功状态的累计退款金额，不考虑售后发起时间，仅要求所选周期内为成功退款状态。"
        },
        {
            "attribute": {
                "index_uuid": 11608
            },
            "hide": false,
            "index_display": "成交订单数",
            "index_name": "pay_order_cnt",
            "index_tip": "截至所选统计周期内，抖音、火山、头条、西瓜四端支付成功（含货到付款）的子订单数（如小明昨日在A店铺支付1笔订单，订单包含3件商品，那么子订单量就是3），包含退款的子订单数"
        },
        {
            "attribute": {
                "index_uuid": 11609
            },
            "hide": false,
            "index_display": "成交人数",
            "index_name": "pay_ucnt",
            "index_tip": "全端支付成功或货到付款确认的用户数汇总，包含退款用户"
        }
    ]